package com.justnow.offer;

/**
 * @author justnow
 * Created on 2020-09-21
 * Description
 */
public class Test01 {
    public static void main(String[] args) {
        // 1 在外部类外部，创建非静态内部类
        Ounter.Inner inner = new Ounter().new Inner();

    }
}

class Ounter {
    private String str = "外部类中的字符串";
    class Inner {
        private String inStr = "内部类中的字符串";
        public void print() {
            System.out.println(str);
        }
    }
    public void fun() {
        Inner in = new Inner();
        in.print();
    }
}

class Ounter2 {
    private String str = "外部类中的字符串";
    class Inner2 {
        private String inStr = "内部类中的字符串";
        public void print() {
            System.out.println(str);
        }
    }
    public void fun() {
        Inner2 in = new Inner2();
        in.print();
    }
}